export interface Device {
  id: string;
  deviceId: string;
  name: string;
  type: string;
  status: 'online' | 'offline';
  lastSeen?: string;
  lastHeartbeat?: string;
  temperature?: number;
  humidity?: number;
  createdAt: string;
  updatedAt: string;
  userId: string;
  config?: DeviceConfig;
}

export interface DeviceConfig {
  samplingInterval: number;
  uploadInterval: number;
  alarmThresholds: {
    temperature: {
      min: number;
      max: number;
      high: number;
      low: number;
    };
    humidity: {
      min: number;
      max: number;
      high: number;
      low: number;
    };
    pressure: {
      min: number;
      max: number;
      high: number;
      low: number;
    };
  };
  wifi?: {
    ssid: string;
    password: string;
  };
  mqtt?: {
    server: string;
    username: string;
    password: string;
  };
}

export interface DeviceData {
  _id: string;
  deviceId: string;
  userId: string;
  timestamp: string;
  data: {
    temperature?: number;
    humidity?: number;
    battery?: number;
    signal?: number;
  };
  metadata?: {
    firmwareVersion?: string;
    ipAddress?: string;
    connectionType?: 'wifi' | 'ethernet' | 'cellular';
    signalStrength?: number;
  };
  createdAt: string;
  updatedAt: string;
  __v: number;
}

export type ChartDataPoint = DeviceData; 